// nativedlltest.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
#include "nativedlltest.h"
#include "WinFile.h"
#include "System.h"

// create native object for XVM
int STDCALL create_xort_object( lpcstr lpszName, xunknown **ppOut )
{
    if( !lpszName || !ppOut )
        return FALSE;

    if( strcmp( lpszName, "System" ) == 0 )
    {
        CSystem *pSys = new CSystem();
        if( !pSys )
            return FALSE;

        pSys->AddRef();
        (*ppOut) = pSys;
    }
    else if( strcmp( lpszName, "WinFile" ) == 0 )
    {
        CWinFile *pFile = new CWinFile();
        if( !pFile )
            return FALSE;

        pFile->AddRef();
        (*ppOut) = pFile;
    }
    else
        return FALSE;

    return TRUE;
}

